package com.example.librarymanagementsystembackend.bookmanagement.entity;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.REQUIRED;

/**
 * 图书类别
 */
@Data
@Schema(description = "图书类别")
public class BookCategory {
    @Schema(description = "图书类别标识", requiredMode = REQUIRED, example = "1")
    private int id;
    @Schema(description = "图书类别名", requiredMode = REQUIRED, example = "自然科学")
    private String name;   // 图书类别名称
    @Schema(description = "子类列表", type = "array", implementation = BookCategory.class)
    private List<BookCategory> children = new ArrayList<>();
    @Schema(description = "图书列表", type = "array", implementation = BookInformation.class)
    private List<BookInformation> books = new ArrayList<>();
}